<script type="text/javascript">
	jQuery(document).ready(function(){
    	jQuery("#form1").validationEngine();
   });
	
</script>
<form id="form1" name="form1" method="post" action="<?php echo $do_addedit_link;?>" enctype="multipart/form-data">
  <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td align="left" class="block-block"><?php echo $action?> Player</td>
    </tr>
    <tr>
      <td class="border_add"><table width="90%" border="0" align="left" cellpadding="4" cellspacing="4">
          <tr>
            <td width="22%" align="right" valign="middle" nowrap="nowrap"><span class="error">*</span>Select Game</td>
            <td width="3%" align="center" valign="middle">:</td>
            <td width="75%" colspan="2">
		<select name="game_id" style="width:115px;">
		<?php for($i=0;$i<count($game);$i++){ ?>
		<option value="<?php echo $game[$i]['id']; ?>"><?php echo $game[$i]['game_name']; ?></option>
		<?php } ?>
		</select>
		
	    </td>
          </tr>
	   <tr>
            <td width="22%" align="right" valign="middle" nowrap="nowrap"><span class="error">*</span>Select Role</td>
            <td width="3%" align="center" valign="middle">:</td>
            <td width="75%" colspan="2">
		<select name="player_role" style="width:115px;" id="player_role" class="validate[required]">
			<option value="" >select a role </option>
		<?php
		foreach($role as $key => $val){ ?>
		<option value="<?php echo $key; ?>" <?php if($key == $player_role){ echo 'selected ="selected"' ; } ?> ><?php echo $val; ?></option>
		<?php } ?>
		</select>
		
	    </td>
          </tr>
	  <tr>
            <td width="22%" align="right" valign="middle" nowrap="nowrap"><span class="error">*</span>Name</td>
            <td width="3%" align="center" valign="middle">:</td>
            <td width="75%" colspan="2">
		
		<input type="text" name="player_name" id="player_name" class="validate[required] textbox" style="width:280px;" value="<?php echo $player_name;?>" maxlength="100" >
		
	    </td>
          </tr>
	  <tr>
            <td width="22%" align="right" valign="middle" nowrap="nowrap"><span class="error">*</span>Point</td>
            <td width="3%" align="center" valign="middle">:</td>
            <td width="75%" colspan="2">
		<input type="text" name="point_value" id="point_value" class="validate[required,custom[number]] text-input" style="width:280px;" value="<?php echo $point_value;?>" maxlength="100" >
		
		
	    </td>
          </tr>
	  <tr>
            <td width="22%" align="right" valign="middle" nowrap="nowrap">XML Player Id</td>
            <td width="3%" align="center" valign="middle">:</td>
            <td width="75%" colspan="2">
		<input type="text" name="xml_player_id" id="xml_player_id" class="" style="width:280px;" value="<?php echo $xml_player_id ;?>" maxlength="100" >
		
	    </td>
          </tr>
			<?php for($i=0;$i<count($details);$i++){?>
			 <tr>
            <td width="22%" align="right" valign="top" nowrap="nowrap"><?php echo $details[$i]['format_name']; ?></td>
            <td width="3%" align="center" valign="top">:</td>
            <td width="75%" colspan="2" valign="top">
		
		
		
		
		
		
		
		<input type="checkbox" name="format_id[]" id="format_id" value="<?php echo $details[$i]['format_id'] ;?>" <?php for($s=0;$s<count($details[$i]['format']);$s++){ if($details[$i]['format_id'] == $details[$i]['saveteam'][$s]['game_format_id']){ echo 'checked'; }}?>>
	    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		
		
		
		
		
		
		
		
		
		
		<input type="text" name="player_point<?php echo $details[$i]['format_id'] ;?>" id="player_point" value="<?php echo $details[$i]['points'][0]['player_point'] ; ?>" placeholder="Points" class="validate[custom[number]] text-input" style="width:87px;">
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<select name="team_id<?php echo $details[$i]['format_id'] ;?>[]" id="team_id" style="width:131px;" multiple>
		<?php for($k=0;$k<count($details[$i]['team_list']);$k++){ ?>
		<option value="<?php echo $details[$i]['team_list'][$k]['id']; ?>" <?php for($z=0;$z<count($details[$i]['saveteam']);$z++){ if($details[$i]['team_list'][$k]['id'] == $details[$i]['saveteam'][$z]['team_id']){ echo 'selected="selected"'; }}?>><?php echo $details[$i]['team_list'][$k]['team_name']; ?></option>
		<?php } ?>
		</select>
		
	    </td>
          </tr>
			 <?php } ?>
          <tr>
            <td align="right" valign="middle">&nbsp;</td>
            <td align="center" valign="middle">&nbsp;</td>
            <td colspan="2"><input type="submit" name="Submit" value=" Submit " onmouseover="this.className='normal-bttn1'" onmouseout="this.className='normal-bttn'" class="normal-bttn" />
              &nbsp;&nbsp;
              <input name="Submit2" type="button" value="Cancel" onmouseover="this.className='normal-bttn1'" onmouseout="this.className='normal-bttn'" class="normal-bttn" onclick="location.href='<?php echo $back_link?>'"></td>
          </tr>

          <tr>
            <td align="right" valign="middle">&nbsp;</td>
            <td align="center" valign="middle">&nbsp;</td>
            <td colspan="2">&nbsp;</td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
